J.Oc.rc({
    mr: function(a, b, c, d) {
        function f(b) {
            var d = this.Pg(c);
            this.set("zoom", b);
            var f = this.Pg(c).Ba(d),
                k = (this.Qm ? this.rotation: 0) * Math.PI / 180,
                d = f.x * Math.cos(k) + Math.sin(k) * f.y,
                f = -Math.sin(k) * f.x + Math.cos(k) * f.y;
            this.set("centerCoords", this.get("centerCoords").add((new J.C(d, f)).Mb(this.N)));
            d && f && this.Z("mapmove");
            b === a && Math.floor(a) === a && (this.set("targetLevel", null), g && (this.Z("zoomchange"), this.Z("zoomend")), h && this.k("moveend"), this.k("zoomend"), this.Cc = null)
        }
        J.f.aa && (b = !0);
        a = a || this.get("zoom");
        a = Math.min(Math.max(a, this.get("zooms")[0]), this.get("zooms")[1]);
        var g = a !== this.get("zoom"),
            h = !!c;
        this.zd && (this.zd.stop(), this.zd = null);
        c = c || this.get("centerCoords");
        var k;
        this.nb && this.nb.ah && (this.nb.stop(), this.nb.Np && (d = !0), this.nb.Ck && (k = !0), this.nb = null, this.set("targetLevel", null));
        this.Cc && this.Cc.ah && (this.Cc.stop(), d = !0, this.Cc.Ck && (k = !0), this.Cc = null, this.set("targetLevel", null));
        g && !d && this.Z("zoomstart");
        h && !k && this.Z("movestart");
        this.k("zoomstart");
        b ? f.call(this, a) : (this.set("targetLevel", a), this.Cc = new J.Ff(this.get("zoom"), a, null, 0.1), this.Cc.Np = g, this.Cc.Ck = h, this.Cc.transition = function(a, b, c) {
            return 500 <= c ? b: (b - a) * (1 - Math.pow(1 - c / 500, 4)) + a
        },
            this.Cc.Ok = f, this.Cc.oi(this))
    },
    Wm: function(a, b, c, d) {
        a || (a = this.nb ? this.nb.WG: this.get("targetLevel") || this.get("zoom"));
        b || (b = this.nb ? this.nb.Gx: this.get("center"));
        var f = a !== this.get("zoom"),
            g = !b.xb(this.get("center")),
            h = !1,
            k = !1;
        this.Cc && this.Cc.ah && (this.Cc.stop(), h = !0, this.Cc.Ck && (k = !0), this.Cc = null, this.set("targetLevel", null));
        this.nb && this.nb.ah && (this.nb.stop(), this.nb.Np && (h = !0), this.nb.Ck && (k = !0), this.nb = null, this.set("targetLevel", null));
        this.zd && (this.zd.stop(), this.zd = null);
        if (f || g) {
            if (!this.get("bounds").contains(b) || f && J.f.aa) c = !0;
            if (c) f && (h || (this.k("zoomstart"), this.Z("zoomstart")), this.set("zoom", a), this.Z("zoomchange"), this.Z("zoomend"), this.k("zoomend")),
            g && (k || d || (this.Z("movestart"), this.k("movestart")), this.set("center", b), this.Z("mapmove"), this.k("moveend", {
                Ev: d
            })),
                this.set("targetLevel", null);
            else {
                this.set("targetLevel", a);
                var l = a - this.get("zoom"),
                    m = b.Ba(this.get("center"));
                this.nb = new J.Ff(1, 0, null, 0.0010);
                this.nb.Np = f;
                this.nb.Ck = g;
                this.nb.Gx = b;
                this.nb.WG = a;
                this.nb.transition = function(a, b, c) {
                    return 500 <= c ? 0 : Math.pow(1 - c / 500, 2)
                };
                this.nb.Ok = function(c) {
                    f && (0.01 > Math.abs(l * c) ? (this.set("zoom", a), this.Z("zoomchange"), this.Z("zoomend"), f = !1, this.k("zoomend")) : this.set("zoom", a - l * c));
                    if (g) {
                        var h = b.Ba(m.Mb(c));
                        if (J.f.aa) {
                            var k = this.Ta(this.get("center")),
                                s = this.Ta(h);
                            this.ig(this.ua.Uf, k.x - s.x, k.y - s.y);
                            this.set("center", h, !0);
                            this.set("centerCoords", this.zb(h), !0)
                        } else this.set("center", h)
                    }
                    0 === c ? (this.nb && (this.nb.stop(), this.nb = null), this.set("targetLevel", null), g && (this.k("mapmove"), this.k("moveend", {
                        Ev: d
                    })), this.nb = null, J.f.aa && this.set("display", 1)) : g && this.Z("mapmove")
                };
                this.nb.oi(this);
                f && !h && (this.k("zoomstart"), this.Z("zoomstart")); ! g || k || d || (this.k("movestart"), this.Z("movestart"))
            }
        }
    }
});